package com.motion.design.responsechain;

public class Employee implements Handler {

    private Handler next;

    @Override
    public void response(String message) {
        if (message.equals("employee")) {
            System.out.println("I am Employee");
        } else {
            if (next != null) {
                next.response(message);
            }
        }
    }

    @Override
    public void setHandler(Handler next) {
        this.next = next;
    }

    @Override
    public Handler getHandler() {
        return next;
    }
}
